//@ sourceURL=AccidentRecordView.js
Ext.ns("AccidentRecordView");
AccidentRecordView = Ext.extend(Ext.Panel, {
    constructor : function(a) {
        Ext.applyIf(this, a);
        var all=this.initUIComponents();
        AccidentRecordView.superclass.constructor.call(this, {
            id : "AccidentRecordView",
            title : "事故档案管理",
            region : "center",
            layout : "border",
            border : false,
            iconCls : "menu-position",
            items : [all.yearGridPanel,all.yearGridSearchPanel,all.yearGridTreePanel]
        });
    },
    initUIComponents : function() {
    	var yearGridComponents=new createyeargridview({
            topbar : {
                inputFormName : 'AccidentRecordForm',
                topbarAdd:{
                    hidden:false
                },
                topbarDel:{
                    hidden:false
                }
            },
            search : {
                items : [ {
                    style : "margin:5px 5px 5px 5px;",
                    text : "事故名称"
                }, {
                    columnWidth : 0.2,
                    xtype : "textfield",
                    name : "Q_accidentName_S_LK",
                    maxLength : 256
                } ]
            },
            grid : {
                title : "事故管理列表",
                rowActions:true,
                listUrl : __ctxPath + "/accidentmanage/listAccidentRecord.do",
                removeUrl : __ctxPath + "/accidentmanage/deleteAccidentRecord.do",
                fields : [ "id", 'years', 'accidentNumber', "accidentName", "accidentLevel", "accidentPrincipal","minorAccidentPrincipal","user","notetaker","accidentTime","handler","handleDate","place","process","reason","result","evidence","measure","effect","pursuant","announcements"],
                columns : [ {
                    header : "id",
                    dataIndex : "id",
                    hidden : true
                }, {
                    header : "年份",
                    dataIndex : "years",
                    width : 50,
                    sortable : true
                },
                {
                    header : "事故名称",
                    dataIndex : "accidentName",
                    width : 100
                },{
                    header : "事故发生时间",
                    dataIndex : "accidentTime",
                    width : 70
                },{
                    header : "主要负责人",
                    dataIndex : "accidentPrincipal",
                    width : 100
                },{
                    header : "事故发生地点",
                    dataIndex : "place",
                    width : 70
                }, 
                {
                    header : "事故处理时间",
                    dataIndex : "handleDate",
                    width : 70
                },{
                    header : "事故原因",
                    dataIndex : "reason",
                    width : 100
                },{
                	 header : "填报人",
                     dataIndex : "notetaker",
                     width : 100
                },
                    /*header : "管理",
                    dataIndex : "id",
                    sortable : false,
                    width : 80,
                    renderer : function(j, i, g, m, h) {
                        //var l = g.data.id;
                        var l =j;
                        var k = "";
                        if (l) {
                            if (isGranted("_ConMaterialDel")) {
                                k += '<button title="删除" value=" " class="btn-delete" onclick="ConMaterialsBaseInfoView.remove('
                                        + l + ')"></button>';
                            }
                                                           
                        }
                        return k;
                    }
                } ,*/
            ]
            },
            tree : {
                treeUrl : __ctxPath + "/accidentmanage/treeLoadAccidentRecord.do"
            }
            
        });
        return yearGridComponents;
    }
});

